<tc_include file="Public:head" />
<title>提现中心</title>
<link href="__PUBLIC__/js/artDialog/skins/default.css" rel="stylesheet" />
</head>
<body style="background-color:#f3f3f3">
<tc_include file="Public:header" />
<tc_include file="Home/Personal:header" />
<div class="container">
	<div class="Firstfloor clearfix">
		<div class="Leftlayout">
			<tc_include file="Home/Personal:navigation" />
		</div>
		<div class="rightlayout">
			<div class="clearfix">
			
				<div class="shouyez">
					<h3 class="personal_h3">
						<i class="h3_one"></i>
						提现中心
						<span>
							总{$getConfigName['name_votes']}:{$rs['votestotal']} <a class="icon"></a> ｜ 可提现{$getConfigName['name_votes']}:{$rs['votes']}
						 <a class="icon"></a>
						</span>
						
						<div class="linexi"></div>
					</h3>
					<div class="tixian-list"><a href="index.php?m=Personal&a=cash_list">提现记录</a></div>
				</div>
				
			</div>
			
			<div class="schedule">
			
				<div class="exchange">
				   <i class="dotico dotico-l"></i>
				   <i class="dotico dotico-r"></i>
					 <h4>{$getConfigName['name_votes']}兑换RMB</h4>
					 <p class="item">
						<label>输入要提现的{$getConfigName['name_votes']}数</label>
						<input type="text" id="coin_z" name="coin_z" placeholder='0' class="coin_z"/>
					 </p>
					  <p class="item">
						<label>可到账金额</label>
						<span class="fu">　￥</span>
						<a id="coin_m" name="coin_m" class="fu">0</a>
					 </p>
					  <div class="item">
						<label>提现账户</label>
						<select id="account">
							<volist name="zlist" id="vo">
								<option value ="{$vo.id}">{$vo.type_account}</option>
							</volist>
						</select>
						<a href="index.php?m=Personal&a=account_list" style="margin-left:10px;">账号管理</a>
					 </div>
					 <p class="btn">
						<!--<button type="submit" onclick="Personal.exchange()">
							<span>提现</span>
						</button>-->
						<button type="submit" onclick="exchange()">
							<span>提现</span>
						</button>
					 </p>
				</div>
				
				<div class="exchange-list">
					<div class="tip">
						<span>
							<strong>温馨提示：</strong>
							<em>{$rs['tips']}</em>
						<span>
					</div>
				</div>
				
			</div>
			
		</div>
  </div>
</div>
<tc_include file="Public:footer" />
<tc_include file="Home/Personal:footer" />
<script>
	var uid="{$uid}";
	var token="{$token}";
	var bili="{$rs['cash_rate']}";
	$('#coin_z').live('input propertychange', function(){
		var coin_z=$('#coin_z').val();
		var coin=coin_z/bili;
		$("#coin_m").text(coin);
	})
	
	function exchange(){
		var accountid=$("#account  option:selected").val();
		var cashvote=$('#coin_z').val();
		if(accountid==''){
			layer.msg("请输入账号");
			return;

		}else if(cashvote==''){
			layer.msg("请输入提现金额");
			return;

		}
		$.ajax({
			type: "POST",
			url:'/index.php?m=Personal&a=edit_exchange',
			data:{
				uid:uid,
				token:token,
				accountid:accountid,
				cashvote:cashvote,
			},// 你的formid
			dataType:'json',
			async: false,
			error: function(){
				layer.msg("提现失败！");
			},
			success: function(data){
				layer.msg(data['msg'],{time:2000},function(){
					if(data['code']==0){
						window.location.reload();
					}
				});
			}
		});
	}
</script>
</body>
</html>